home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 June
/
EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso
/
earcd
/
utmisc1
/
ovr50711.lha
/
Over5
/
doc
/
boot.tech
< prev
next >
Wrap
Text File
|
1996-05-12
|
4KB
|
112 lines
boot.tech
---------
Copyright (c) 1995,1996 Daniel Kahlin <tlr@stacken.kth.se>
(last changed 960415)
---------------------------------------------------------------------------
Over5 old boot protocol specification
by Daniel Kahlin <tlr@stacken.kth.se>
Purpose: To transfer an arbitrary program to a C64.
Over5 in boot mode starts with sending sync. It consists of 6 'S' bytes
sent with a 0.3 second delay in between. After this the start and end
addresses are sent. Then the data follows, and last a checksum.
The addition between all bytes excluding sync must end up to be 0. (if
anded with $ff)
The actual data transferred are:
$c000-len to $c000 : the program specified
$c000 to $c0xx : the copytail
When all data has been transferred ok, just jump to the copytail and it
will move the data down to basic memory and prompt you to save it.
This is the old boot program 'bootold.asc'
---
100 OPEN2,2,3,CHR$(5)+CHR$(0)
110 PRINT"WAITING..."
120 GOSUB 400:IF A$<>"S" THEN 120
130 GOSUB 400:IF A$="S" THEN 130
140 C=A:I=A:GOSUB 400:I=I+A*256
150 GOSUB 400:E=A:GOSUB 400:E=E+A*256
160 GOSUB 400:PRINT"*";:POKEI,A:I=I+1:IF I<>E THEN 160
170 GOSUB 400:IF C<>0 THEN PRINT:PRINT"?CHK ERROR":CLOSE2:END
180 PRINT:PRINT"CHK OK":CLOSE2:END
400 GET#2,A$:IF ST=8 THEN 400
410 IF A$="" THEN A$=CHR$(0)
420 A=ASC(A$):C=(C+A)AND255:RETURN
---
the copytail source is in Over5/6502/copytail64.asm
/END
---------------------------------------------------------------------------
Over5 new boot protocol specification
by Daniel Kahlin <tlr@stacken.kth.se>
Purpose: To transfer an arbitrary program to any cbm 8-bit computer.
The new boot works like a two stage rocket. The first stage (the basic
program) just reads the real boot program into memory.
To be able to use it with the VIC-20 and to simplify the program, the data
sent to the basic program may not contain any 0 bytes. This means we need
the real boot program to 'unpack' itself. (and maybe relocate) It also
means we have to have two checksum bytes. To simplify even more the
addresses in memory are fixed. 512 bytes are always transferred including
the checksum bytes. Addresses $1770 (6000) to $196f (6511) should work on
all configurations of the VIC-20, and the C-64. Please note that the code
is completely relocatable, i.e you could select another address space like
$c000 to $c1ff. The code is machine independant and will probably work on
a PET and a PLUS/4, etc... Please notify me with your results if you test
it. To get rid of 0 bytes we find a byte that is not used at all in the
'booter', and translate every occurance of 0 to that byte. (there are a
lot of bytes that occur zero times.)
First we send the booter at 150 baud. Start with a sync (6 'S' bytes
followed by an 'E'), then follows 512 bytes of data. The sum of all bytes
MUST be zero. When done we 'sys' the code, which then 'unpacks' and
relocates to MEMTOP-$420. (When the code later opens an RS232 file, kernal
lowers MEMTOP by $200 for buffers)
Second we send the data at 600 baud. Start with a sync (6 'S' bytes
followed by an 'E'), To get rid of 0 bytes this time we encode $11 as
$11,$11 and $00 as $11,$80. As end marker we us $11,$01. The data
is received from MEMBOT+1 and up ($0801 on a stock c64). When the end
marker is encountered two more bytes are read, (but not stored) these are
the checksum bytes. The sum of all received bytes excluding sync MUST be
0.
After all is transferred the user gets the message 'OK, NOW SAVE TO DISK!'
and a 'READY.' prompt. At this point the basic end pointers $2d/$2e has
been set, thus a 'SAVE' command will save the program.
This is the new boot program 'boot.asc'
(please note that you cannot simplify the two 'CLOSE 2' statements
to a single one in line 185, because closing an RS232 file does
a 'CLR' command.)
---
100 OPEN2,2,3,CHR$(5)+CHR$(0)
110 PRINT"WAITING..."
120 GET#2,A$:IF A$<>"S" THEN 120
130 GET#2,A$:IF A$="S" OR A$="" THEN 130
140 FOR I=6000 TO 6511
150 GET#2,A$:IF A$="" THEN 150
160 A=ASC(A$):C=(C+A)AND255
170 POKE I,A:PRINT "#";
180 NEXT
190 IF C<>0 THEN PRINT:PRINT"?CHK ERROR":CLOSE2:END
200 CLOSE2:SYS 6000
---
the booter source is in Over5/6502/booter.asm
/END